Repository navigation
fix(quota): preserve runtime capabilities after native claim - #9174
loopx-agent wants to merge 1 commit into
Conversation
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
[P2] 升级后恢复已有领取时,Ready guard 仍会丢掉原 Turn 的能力。 基线 CLI 保存实际原生捕获并提交领取,然后在 Ready guard 前中断。换成精确候选后,原领取和 Turn 仍能读回,File 与 SQLite 均返回 ready,但原捕获的 filesystem_write、shell 在恢复命令、Ready 捕获及语义结算模板中都消失。恢复直接使用旧 journal 的紧凑请求,而这个请求没有新字段。请在读取旧请求时,按原摘要验证并恢复原捕获中的能力,再使用现有过滤器。原捕获不可用时给出可操作的同 Turn 恢复错误。 读取旧请求 构造恢复命令
动机 / Motivation
使用原生 Codex Host 的 Agent 需要在领取前后继续使用该 Turn 已观测到的运行时能力。基线的 Ready guard 丢掉初次检查记录的能力,结算命令也少了对应参数。本提交修复了由新运行时写入的捕获,升级前已经领取的 Turn 仍会生成缺参的 Ready 结果。范围是本地原生 CLI 和恢复协议,正式安装的 Host 与跨版本实际使用仍待验证。保存原件的升级恢复是这次唯一剩余的代码缺口。
改动思路 / Approach
保留原领取与同 Turn 复验机制,用现有 capability 过滤器传递原捕获的运行时观测。旧 journal 的缺字段路径应该回到已有摘要校验边界读取原件,将未知状态与原观测为空区分开。范围是本地原生 CLI 和恢复协议,正式安装的 Host 与跨版本实际使用仍待验证。
具体改动 / Changes
精确提交 7aac3b8e63b66ce1c9d5be66156523317169e34b,目标基线 64353773dc8b1ca82ff531cc7653dec6c3d41c0b。一个签署提交,三个文件 +43/-4。 TurnEnvelope 恢复规范
- same-turn-inputs 新写入的准备请求在自动复验和中断恢复命令里带上原运行时能力,初次与 Ready 捕获使用同一 Turn。
- owner-gates 自动和恢复共用原有过滤器,排除
credentials和production_access。领取参数、摘要、租约和结算 effect 继续由原有机制验证。 - saved-recovery 用基线
quota context-project生成旧 journal,实际提交原领取后中断。候选返回同一个领取并运行它提供的readiness_command。比较这个命令写下的decision.json与原捕获。两个后端均从["filesystem_write","shell"]变成[],语义结算模板没有对应选项。
对主干的风险 / Risks
两个相关 pytest 模块在候选上 106 项通过。相同的新回归断言在基线按预期失败 8 项,其中 6 项走真 CLI 和原生捕获。标准 premerge 6 项直接检查、13 项选中检查均通过。新增跨版本序列的两个失败发生在正常 Ready 路径,捕获和原始结算身份均保留。复核使用本机隔离 File/SQLite、CLI 和合成 Todo,未运行正式 App、远端 SSH 或真实扣额,未查询托管 CI。
我的整体评价 / Verdict
REQUEST_CHANGES。 当前生产端与新捕获修复配套,仍需补上旧 journal 的同摘要恢复。回归同时覆盖旧文件中确实没有观测能力、原捕获缺失、原能力正常保留和原领取不重复。升级场景通过后再收口。
English verdict: REQUEST_CHANGES — 7aac3b8 preserves runtime capabilities for newly prepared requests, but an interrupted claim created before upgrade can still resume as ready with an empty capability set and an incomplete closeout command.
Problem
After a native Host claims a Todo, the ready guard can drop the runtime capabilities recorded by the original guard. The resulting settlement command can omit capabilities even when the Todo and Turn are still the same.
Change
Carry the observed runtime capability list from the original capture into automatic and interrupted readiness checks. Reuse the existing CLI projection filter for owner-held gates.
Validation